<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>左右两边固定中间自适应</title>
</head>
<style>
    * {
        padding: 0;
        margin: 0;
    }

    /* 方式一 */
    .fa {
        height: 50px;
    }

    .left {
        width: 200px;
        height: 100%;
        float: left;
        background-color: #ccc;
    }

    .center {
        margin: 0 200px;
        height: 100%;
        background-color: #fff;
        border: 1px solid #f0f;
    }

    .right {
        width: 200px;
        height: 100%;
        float: right;
        background: #cfc;
    }

    /* 方式二 */
    .fa2 {
        display: flex;
        width: 100%;
        height: 50px;
    }

    .left2 {
        background: #ff0;
        height: 100%;
        width: 200px;
        flex: 0 0 200px;
        /* 不放大 不缩小 固定宽度200px */
    }

    .center2 {
        background: #0f0;
        height: 100%;
        width: 200px;
        flex: 1 1 auto;
        /* 可放大 可缩小,自适应宽度 */
    }

    .right2 {
        background-color: aliceblue;
        height: 100%;
        width: 200px;
        flex: 0 0 200px;
    }

    /* 方式三 */
    .fa3 {
        height: 50px;
        width: 100%;
        display: grid;
        grid-template-columns: 200px auto 200px;
        /*三列，第一三列200px,二列自适应*/
        grid-template-rows: 50px;
        /*行高*/
    }

    .left3 {
        background: #ff0;
    }

    .center3 {
        background: #0f0;
    }

    .right3 {
        background-color: aliceblue;
    }
</style>

<body>
    <!-- 方式一 -->
    方式一：浮动
    <div class="fa">
        <div class="right">333</div>
        <div class="left">111</div>
        <div class="center">222</div>
    </div>

    <!-- 方式二 -->
    方式二：flex 布局
    <div class="fa2">
        <div class="right2">111</div>
        <div class="center2">222</div>
        <div class="left2">222</div>
    </div>

    <!-- 方式三 -->
    方式三：grid 实现
    <div class="fa3">
        <div class="left3">111</div>
        <div class="center3">222</div>
        <div class="right3">333</div>
    </div>
</body>

</html>